/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package prehilife;

import javax.swing.JTextField;

/**
 *
 * @author Piotr
 */
public class PrehiOptionsChooser extends javax.swing.JDialog {

    /**
     * Creates new form PrehiOptionsChooser
     */
//    public PrehiOptionsChooser(java.awt.Frame parent, boolean modal) {
//        super(parent, modal);
//        initComponents();
//    }
    public PrehiOptionsChooser(boolean modal) {
        super();
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        labMam = new javax.swing.JLabel();
        labMem = new javax.swing.JLabel();
        labCave = new javax.swing.JLabel();
        labHut = new javax.swing.JLabel();
        labTurn = new javax.swing.JLabel();
        labHp = new javax.swing.JLabel();
        labColl = new javax.swing.JLabel();
        labSize = new javax.swing.JLabel();
        mam = new javax.swing.JTextField();
        mem = new javax.swing.JTextField();
        cave = new javax.swing.JTextField();
        hut = new javax.swing.JTextField();
        turn = new javax.swing.JTextField();
        hp = new javax.swing.JTextField();
        coll = new javax.swing.JTextField();
        sizeGrid = new javax.swing.JTextField();
        butLaunch = new javax.swing.JButton();
        aff = new javax.swing.JComboBox();
        autoCheck = new javax.swing.JCheckBox();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        labMam.setText("Nb mammouth");

        labMem.setText("Nb member");

        labCave.setText("Nb Caves");

        labHut.setText("Nb Huts");

        labTurn.setText("Max turn in cave");

        labHp.setText("Max Hp");

        labColl.setText("Collapse chance");

        labSize.setText("X Y size");

        mam.setText("3");

        mem.setText("3");

        cave.setText("3");

        hut.setText("3");

        turn.setText("3");

        hp.setText("3");

        coll.setText("3");

        sizeGrid.setText("5");

        butLaunch.setText("GO !");
        butLaunch.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                butLaunchActionPerformed(evt);
            }
        });

        aff.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Pictured", "Textuel" }));
        aff.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                affActionPerformed(evt);
            }
        });

        autoCheck.setSelected(true);
        autoCheck.setText("auto");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(labMam)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(mam, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(labMem)
                                .addGap(18, 18, 18)
                                .addComponent(mem))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(labCave)
                                .addGap(26, 26, 26)
                                .addComponent(cave))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(labHut)
                                .addGap(34, 34, 34)
                                .addComponent(hut)))
                        .addGap(66, 66, 66)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(labTurn)
                                    .addComponent(labHp))
                                .addGap(7, 7, 7)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(hp, javax.swing.GroupLayout.DEFAULT_SIZE, 25, Short.MAX_VALUE)
                                    .addComponent(turn)))
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(labColl)
                                    .addComponent(labSize))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(sizeGrid)
                                    .addComponent(coll)))))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(123, 123, 123)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(aff, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(autoCheck))
                            .addComponent(butLaunch))))
                .addContainerGap(41, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(aff, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(autoCheck))
                .addGap(7, 7, 7)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labMam)
                    .addComponent(labTurn)
                    .addComponent(mam, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(turn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labMem)
                    .addComponent(labHp)
                    .addComponent(mem, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(hp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labCave)
                    .addComponent(labColl)
                    .addComponent(cave, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(coll, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labHut)
                    .addComponent(labSize)
                    .addComponent(hut, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(sizeGrid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(butLaunch)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void butLaunchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_butLaunchActionPerformed
        setVisible(false);
    }//GEN-LAST:event_butLaunchActionPerformed

    private void affActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_affActionPerformed
       if(aff.getSelectedIndex()!=0){
           autoCheck.setSelected(true);
           autoCheck.setEnabled(false);
       }
       else{
           autoCheck.setEnabled(true);
       }
    }//GEN-LAST:event_affActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JComboBox aff;
    private javax.swing.JCheckBox autoCheck;
    private javax.swing.JButton butLaunch;
    private javax.swing.JTextField cave;
    private javax.swing.JTextField coll;
    private javax.swing.JTextField hp;
    private javax.swing.JTextField hut;
    private javax.swing.JLabel labCave;
    private javax.swing.JLabel labColl;
    private javax.swing.JLabel labHp;
    private javax.swing.JLabel labHut;
    private javax.swing.JLabel labMam;
    private javax.swing.JLabel labMem;
    private javax.swing.JLabel labSize;
    private javax.swing.JLabel labTurn;
    private javax.swing.JTextField mam;
    private javax.swing.JTextField mem;
    private javax.swing.JTextField sizeGrid;
    private javax.swing.JTextField turn;
    // End of variables declaration//GEN-END:variables

    public int getCave() {
        return Integer.parseInt(cave.getText());
    }

    public int getColl() {
        return Integer.parseInt(coll.getText());
    }

    public int getHp() {
        return Integer.parseInt(hp.getText());
    }

    public int getHut() {
        return Integer.parseInt(hut.getText());
    }

    public int getMam() {
        return Integer.parseInt(mam.getText());
    }

    public int getMem() {
        return Integer.parseInt(mem.getText());
    }

    public int getSizeGrid() {
        return Integer.parseInt(sizeGrid.getText());
    }

    public int getTurn() {
        return Integer.parseInt(turn.getText());
    }
    public int getTypeapp(){
        return 1;
    }
    public boolean getAuto(){
        return autoCheck.isSelected();
    }

    public int getTypeAff() {
        return aff.getSelectedIndex();
    }
}
